<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>文章列表</title>
    <style>
        /* 左侧侧边栏样式 */
        .sidebar {
            width: 200px;
            height: 100vh;
            position: fixed;
            top: 0;
            left: 0;
            background-color: #333;
            color: white;
            padding-top: 20px;
            box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
            display: flex;
            flex-direction: column;
        }

        .sidebar h2 {
            margin: 0 0 20px;
            text-align: center;
            color: white;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 50px;
        }

        .sidebar a {
            width: 180px;
            text-align: center;
            color: white;
            text-decoration: none;
            margin: 10px 0;
            padding: 10px;
            border-radius: 5px;
            display: block;
            background-color: #444;
        }

        .sidebar a:hover {
            background-color: #45a049;
        }

        /* 右侧内容样式 */
        .content {
            margin-left: 220px;
            padding: 20px;
        }

        .search-bar {
            display: flex;
            justify-content: flex-start;
            margin-bottom: 20px;
        }

        .search-bar input[type="text"] {
            padding: 8px;
            width: 300px;
            border: 1px solid #ddd;
            border-radius: 5px;
        }

        .search-bar button {
            padding: 8px 15px;
            background-color: #4CAF50;
            color: white;
            border: none;
            cursor: pointer;
            border-radius: 5px;
            margin-left: 10px;
        }

        .search-bar button:hover {
            background-color: #45a049;
        }

        h1 {
            text-align: center;
            color: #333;
            margin: 20px 0;
        }

        ul {
            list-style: none;
            padding: 0;
        }

        li {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin: 10px 0;
            padding: 10px;
            background-color: #f9f9f9;
            border: 1px solid #ddd;
            border-radius: 5px;
        }

        li a {
            color: #4CAF50;
            text-decoration: none;
            font-size: 18px;
            font-weight: bold;
        }

        li a:hover {
            color: #45a049;
        }

        .publish-date {
            font-size: 14px;
            color: #555;
        }
    </style>
</head>
<body>
<div class="sidebar">
    <h2>功能导航</h2>
    <a href="/interactiveFeature">互动功能</a>
    <a href="/dashboard">返回</a>
    <a href="/login">登录</a>
    <a href="/logout">退出登录</a>
</div>

<div class="content">
    <!-- 搜索框 -->
    <form class="search-bar" action="/articles/list" method="get">
        <input type="hidden" name="teamID" value="${teamID}" />
        <input type="text" name="search" placeholder="搜索文章标题" />
        <button type="submit">搜索</button>
    </form>

    <!-- 文章列表标题 -->
    <h1>文章列表</h1>
    <ul>
        <c:forEach var="article" items="${articles}">
            <li>
                <a href="/articles/${article.articleId}/details">${article.title}</a>
                <span class="publish-date">${article.publishDate}</span>
            </li>
        </c:forEach>
    </ul>
</div>
</body>
</html>
